import unittest
from rename_images import replace_mid_nums

class MyTestCase(unittest.TestCase):
    def test_replace_mid_nums1(self):
        des = replace_mid_nums('Baidu_0011_52018111020181110.jpeg',2)
        self.assertEqual('Baidu_000002_52018111020181110.jpeg', des)

    def test_replace_mid_nums1(self):
        des = replace_mid_nums('Baidu_Test_Dataset_1_86704005123040_XVXV_Verify_KW_1_VP_1_Success_1636739135811_Contain_Male.pcm',2)
        self.assertEqual('Baidu_Test_Dataset_1_000002_XVXV_Verify_KW_1_VP_1_Success_1636739135811_Contain_Male.pcm', des)
if __name__ == '__main__':
    unittest.main()
